/*
 +----------------------------------------------------------------------
 + Title        : 首页接口
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-07-08
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 首页接口
 +----------------------------------------------------------------------
*/
import request from '@/utils/httpRequest'

/**
 * 获取首页数据
 * @param number pageSize --------------------------------------条数
 *
 * return json
 * author huwl
 */
export const reqGetHomeDataAPI = (pageSize) => {
  return request({
    method: 'GET',
    url: 'home/index',
    params: {page_size: pageSize}
  })
}

/**
 * 获取首页推荐
 * @param number pageSize --------------------------------------条数
 *
 * return json
 * author huwl
 */
export const reqGetHomeRecommendAPI = (pageSize) => {
    return request({
      method: 'GET',
      url: 'home/recommend',
      params: {page_size: pageSize}
  })
}

/**
 * 猜你喜欢
 * @param number page ------------------------------------------页码
 * @param number pageSize --------------------------------------条数
 *
 * return json
 * author huwl
 */
export const reqGetHomeGoodsGuessAPI = (page, pageSize) => {
  return request({
      method: 'GET',
      url: 'goods/search',
      params: {page, page_size: pageSize}
  })
}

/**
 * 获取轮播图
 * @param object params ---------------------------------------- 参数
 *
 * return json
 * author huwl
 */
export const reqGetBannerAPI = (params) => {
  return request({
      method: 'GET',
      url: 'banner/list',
      params
  })
}